package dataserver.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import dataserver.pojo.SceneDeviceRelation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.persistence.Column;

/**
 *@类:设备与系统关系
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Tag(name = "设备请求实体")
public class SceneDeviceRelationDTO extends BaseIdDTO {
    public SceneDeviceRelationDTO() {

    }

    public SceneDeviceRelationDTO(SceneDeviceRelation relation) {
        this.setId(relation.getId());
        this.stationId = relation.getStationId();
        this.stationName = relation.getStationName();
        this.unrealName = relation.getUnrealName();
        this.type = relation.getType();
        this.equipmentId = relation.getEquipmentId();
        this.equipmentName = relation.getEquipmentName();
        this.equipmentInfo = relation.getEquipmentInfo();
        if (relation.getSceneDevice() != null) {
            this.viewName = relation.getSceneDevice().getViewName();
            this.x = relation.getSceneDevice().getX();
            this.y = relation.getSceneDevice().getY();
            this.z = relation.getSceneDevice().getZ();
        }
    }

    /**
     * 站场id
     */
    @Schema(name = "站场id", example = "2")
    @JsonProperty("stationId")
    private String stationId;

    /**
     * 站场名称
     */
    @Schema(name = "站场名称", example = "301D")
    @JsonProperty("stationName")
    private String stationName;

    /**
     * UE场景中名称
     */
    @Column(name = "unrealName")
    private String unrealName;

    /**
     * 模型类型
     */
    @Schema(name = "模型类型", example = "")
    @JsonProperty("type")
    private String type;

    /**
     * 系统点位编号
     */
    @Schema(name = "系统点位编号", example = "")
    @JsonProperty("equipmentId")
    private String equipmentId;

    /**
     * 系统点位名称
     */
    @Schema(name = "系统点位名称", example = "")
    @JsonProperty("equipmentName")
    private String equipmentName;

    /**
     * 系统点位信息
     */
    @Schema(name = "系统点位信息", example = "")
    @JsonProperty("equipmentInfo")
    private String equipmentInfo;

    /**
     * 模型名称
     */
    @Schema(name = "模型名称", example = "301D_DX_01")
    @JsonProperty("viewName")
    private String viewName;

    /**
     * 经度
     */
    @Schema(name = "经度", example = "106.66333865949751")
    @JsonProperty("x")
    private Double x;
    /**
     * 纬度
     */
    @Schema(name = "纬度", example = "38.20326158833742")
    @JsonProperty("y")
    private Double y;
    /**
     * 高度
     */
    @Schema(name = "高度", example = "7.7")
    @JsonProperty("z")
    private Float z;
}
